package com.mkait.thief.controller;

import com.mkait.thief.bean.vo.BatchRefundVo;
import com.mkait.thief.service.RefundService;
import com.mkait.thief.service.RefundVerifyService;
import com.mkait.thief.util.ResponseWrapper;
import com.mkait.thief.util.WrapResponseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/refundVerify")
@RestController
@Transactional(rollbackFor = Exception.class)
public class RefundVerifyController {

    @Autowired
    private RefundService refundService;

    @Autowired
    private RefundVerifyService refundVerifyService;

    @GetMapping("/verify")
    public ResponseEntity<ResponseWrapper<String>> verifyRefund(@RequestParam("trade_no") String tradeNo){
        String status = refundVerifyService.verifyRefundService(tradeNo);
        return WrapResponseMapper.ok(status);
    }
}
